using System.Collections.Generic;
using Application.Services.PartnersManagement;
using Domain.Model.Partners;
using Presentation.Web.Client.Areas.SalesManagement.Models;
using Presentation.Web.Client.Models;

namespace Presentation.Web.Client.Areas.PartnersManagement.Models
{
    public class PartnersListViewModel
    {
        private readonly IPartnersManagementService _partnersService;

        public PartnersListViewModel(IPartnersManagementService partnersService)
        {
            _partnersService = partnersService;
        }


        /// <summary>
        /// Returns partners list 
        /// </summary>
        public List<Partner> PartnersList
        {
            get
            {
                return _partnersList ?? (_partnersList = _partnersService.GetAllPartners());
            }
        }
        private List<Partner> _partnersList;

        /// <summary>
        /// Navigation items for control panel
        /// </summary>
        public LinksCollectionViewModel ControlPanelActions
        {
            get
            {
                return _controlPanelActions ?? (_controlPanelActions = new SalesViewModel().SalesActionLinks);
            }
        }
        private LinksCollectionViewModel _controlPanelActions;
    }
}